#TRATAMENTO DOS DADOS
documento <- read.csv("C:/Users/lucas.general/Documents/Documentos R Markdown/Jornada_Nova/Jornada.csv", encoding = "UTF-8")
documento <- documento %>%
#rename(grupo = X.U.FEFF.grupo) %>%
mutate(grupo = factor(grupo, levels = c('Não Cliente','Cliente - Sem compra','Cliente - Uma compra','Cliente - Duas compras','Cliente - Mais que duas compras')))
documento_clientes_com_acesso <- read.csv("C:/Users/lucas.general/Documents/Documentos R Markdown/Jornada_Nova/Jornada_clientes_acesso.csv", encoding = "UTF-8")
documento_clientes_com_acesso <- documento_clientes_com_acesso %>%
#rename(grupo = X.U.FEFF.grupo) %>%
mutate(grupo = factor(grupo, levels = c('Não Cliente','Cliente - Sem compra','Cliente - Uma compra','Cliente - Duas compras','Cliente - Mais que duas compras')))
## Base total
documento_completo <- read.csv("C:/Users/lucas.general/Documents/Documentos R Markdown/Jornada_Nova/Jornada_completa.csv", encoding = "UTF-8")
documento_completo <- documento_completo %>%
rename(pk_fvid = X.U.FEFF.pk_fvid) %>%
mutate(grupo = factor(grupo, levels = c('Não Cliente','Cliente - Sem compra','Cliente - Uma compra','Cliente - Duas compras','Cliente - Mais que duas compras')),
grupo2 = ifelse(grupo == 'Não Cliente', 'Não Cliente', 'Cliente'),
grupo2 = factor(grupo2, levels = c('Não Cliente','Cliente'))
)aux <- documento_clientes_com_acesso %>%
filter(pre_cadastro == 1) %>%
select(grupo, clientes) %>%
mutate(porcentagem = round(clientes/sum(clientes)*100,2),
porcentagem = paste0(porcentagem, '%')) %>%
rename('Clientes_sem_Bounce' = clientes,
'Share_Clientes_Sem_Bounce' = porcentagem) %>%
inner_join(
documento %>%
filter(pre_cadastro == 1) %>%
select(grupo, clientes) %>%
mutate(porcentagem = round(clientes/sum(clientes)*100,2),
porcentagem = paste0(porcentagem, '%')) %>%
rename('Possiveis_Clientes' = clientes,
'Share_Clientes' = porcentagem),
by = 'grupo')
aux %>%
arrange(grupo) %>%
mutate(Clientes_Perdidos1 = Possiveis_Clientes - lag(Possiveis_Clientes, 1),
Clientes_Perdidos2 = Clientes_sem_Bounce - lag(Clientes_sem_Bounce, 1)
) %>%
select(grupo, Possiveis_Clientes,Clientes_Perdidos1, Share_Clientes, Clientes_sem_Bounce, Clientes_Perdidos2,
Share_Clientes_Sem_Bounce) %>%
rename('Possiveis Clientes' = Possiveis_Clientes,
'Share Clientes' = Share_Clientes,
'Clientes sem Bounce' = Clientes_sem_Bounce,
'Share Clientes Sem Bounce' = Share_Clientes_Sem_Bounce,
'Clientes Perdidos1' = Clientes_Perdidos1,
'Clientes Perdidos2' = Clientes_Perdidos2) %>%
knitr::kable(caption = "") %>%
kable_styling(bootstrap_options = "striped", full_width = T, font_size = 15)| grupo | Possiveis Clientes | Clientes Perdidos1 | Share Clientes | Clientes sem Bounce | Clientes Perdidos2 | Share Clientes Sem Bounce |
|---|---|---|---|---|---|---|
| Não Cliente | 12615117 | NA | 96.72% | 6509776 | NA | 94.24% |
| Cliente - Sem compra | 196124 | -12418993 | 1.5% | 182848 | -6326928 | 2.65% |
| Cliente - Uma compra | 150910 | -45214 | 1.16% | 139665 | -43183 | 2.02% |
| Cliente - Duas compras | 45226 | -105684 | 0.35% | 42206 | -97459 | 0.61% |
| Cliente - Mais que duas compras | 35137 | -10089 | 0.27% | 33114 | -9092 | 0.48% |
plot1 <- documento %>%
filter(pre_cadastro == 1) %>%
ggplot() +
geom_col(aes(x=grupo, y =clientes/1000, fill = grupo), show.legend = F) +
scale_y_continuous(breaks = seq(0,100000, by = 3000))+
labs(subtitle = "Total Clientes por Grupo",
x = "Grupos",
y = "Clientes (Mil)"
)
plot2 <- documento_clientes_com_acesso %>%
filter(pre_cadastro == 1) %>%
ggplot() +
geom_col(aes(x=grupo, y =clientes/1000, fill = grupo), show.legend = F) +
scale_y_continuous(breaks = seq(0,100000, by = 1000))+
labs(subtitle = "Clientes sem Bounce por Grupo",
x = "Grupos",
y = "Clientes (Mil)"
)
grid.arrange(plot1,plot2)aux <- documento_clientes_com_acesso %>%
filter(pre_cadastro == 1) %>%
mutate(grupo = ifelse(grupo == 'Não Cliente', 'Não Clientes', 'Cliente')) %>%
group_by(grupo) %>%
summarise(clientes = sum(clientes)) %>%
mutate(porcentagem = round(clientes/sum(clientes)*100,2),
porcentagem = paste0(porcentagem, '%')) %>%
rename('Clientes_sem_Bounce' = clientes,
'Share_Clientes_Sem_Bounce' = porcentagem) %>%
inner_join(
documento %>%
filter(pre_cadastro == 1) %>%
mutate(grupo = ifelse(grupo == 'Não Cliente', 'Não Clientes', 'Cliente')) %>%
group_by(grupo) %>%
summarise(clientes = sum(clientes)) %>%
mutate(porcentagem = round(clientes/sum(clientes)*100,2),
porcentagem = paste0(porcentagem, '%')) %>%
rename('Possiveis_Clientes' = clientes,
'Share_Clientes' = porcentagem),
by = 'grupo')
aux %>%
arrange(desc(grupo)) %>%
mutate(Clientes_Perdidos1 = Possiveis_Clientes - lag(Possiveis_Clientes, 1),
Clientes_Perdidos2 = Clientes_sem_Bounce - lag(Clientes_sem_Bounce, 1)
) %>%
select(grupo, Possiveis_Clientes,Clientes_Perdidos1, Share_Clientes, Clientes_sem_Bounce, Clientes_Perdidos2,
Share_Clientes_Sem_Bounce) %>%
rename('Possiveis Clientes' = Possiveis_Clientes,
'Share Clientes' = Share_Clientes,
'Clientes sem Bounce' = Clientes_sem_Bounce,
'Share Clientes Sem Bounce' = Share_Clientes_Sem_Bounce,
'Clientes Perdidos1' = Clientes_Perdidos1,
'Clientes Perdidos2' = Clientes_Perdidos2) %>%
knitr::kable(caption = "") %>%
kable_styling(bootstrap_options = "striped", full_width = T, font_size = 15)| grupo | Possiveis Clientes | Clientes Perdidos1 | Share Clientes | Clientes sem Bounce | Clientes Perdidos2 | Share Clientes Sem Bounce |
|---|---|---|---|---|---|---|
| Não Clientes | 12615117 | NA | 96.72% | 6509776 | NA | 94.24% |
| Cliente | 427397 | -12187720 | 3.28% | 397833 | -6111943 | 5.76% |
Foram utilizados dados de 500.000 Não clientes para análises abaixo
Catálogo muito acessado por clientes sem compra
aux <- documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
group_by(grupo2, first_page_type) %>%
summarise(contagem = n()) %>%
group_by(grupo2) %>%
mutate(porcentagem = contagem/sum(contagem))
aux2 <- aux %>%
filter(first_page_type == 'Catalog') %>%
rename(Catalogo = porcentagem) %>%
select(grupo2, Catalogo) %>%
inner_join(
aux %>%
filter(first_page_type == 'Homepage') %>%
rename(Homepage = porcentagem) %>%
select(grupo2,Homepage),
by = 'grupo2'
)%>%
inner_join(
aux %>%
filter(first_page_type == 'Product') %>%
rename(Product = porcentagem) %>%
select(grupo2, Product),
by = 'grupo2'
)%>%
inner_join(
aux %>%
filter(first_page_type == 'Other') %>%
rename(Other = porcentagem) %>%
select(grupo2, Other),
by = 'grupo2'
)
aux2 <- aux2 %>%
union_all(
(aux2 %>%
filter(grupo2 == 'Cliente') %>%
select(-grupo2)) - (
aux2 %>%
filter(grupo2 == 'Não Cliente') %>%
select(-grupo2))
)
aux2 %>%
ungroup() %>%
mutate(grupo2 = ifelse(is.na(grupo2), 'Diferenca', as.character(grupo2)),
Catalogo = paste0(round(Catalogo*100,2),'%'),
Homepage = paste0(round(Homepage*100,2),'%'),
Product = paste0(round(Product*100,2),'%'),
Other = paste0(round(Other*100,2),'%')
) %>%
knitr::kable(caption = "") %>%
kable_styling(bootstrap_options = "striped", full_width = T, font_size = 15)| grupo2 | Catalogo | Homepage | Product | Other |
|---|---|---|---|---|
| Não Cliente | 27.02% | 12.61% | 41.2% | 19.17% |
| Cliente | 40.42% | 15.84% | 31.33% | 12.42% |
| Diferenca | 13.4% | 3.23% | -9.87% | -6.75% |
aux %>%
ggplot() +
geom_col(aes(x=grupo2,y=porcentagem, fill = first_page_type))+
scale_y_continuous(labels = scales::percent_format())+
labs(title = "Clientes por página de entrada",
x = "Grupos",
y = "Porcentagem"
)+
theme(axis.text.x = element_text(angle = 15, hjust = 1))aux <- documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2, prim_device) %>%
summarise(contagem = n()) %>%
group_by(grupo2) %>%
mutate(porcentagem = contagem/sum(contagem))
aux2 <-aux %>%
filter(prim_device == 'app') %>%
rename(App = contagem,
Porcentagem_App = porcentagem) %>%
select(grupo2, Porcentagem_App) %>%
inner_join(
aux %>%
filter(prim_device == 'm.site') %>%
rename(Msite = contagem,
Porcentagem_Msite = porcentagem) %>%
select(grupo2,Porcentagem_Msite),
by = 'grupo2'
)%>%
inner_join(
aux %>%
filter(prim_device == 'site') %>%
rename(Desk = contagem,
Porcentagem_Desk = porcentagem) %>%
select(grupo2, Porcentagem_Desk),
by = 'grupo2'
)
aux2 <- aux2 %>%
union_all(
(aux2 %>%
filter(grupo2 == 'Cliente') %>%
select(-grupo2)) - (
aux2 %>%
filter(grupo2 == 'Não Cliente') %>%
select(-grupo2))
)
aux2 %>%
ungroup() %>%
mutate(grupo2 = ifelse(is.na(grupo2), 'Diferenca', as.character(grupo2)),
App = paste0(round(Porcentagem_App*100,2),'%'),
Msite = paste0(round(Porcentagem_Msite*100,2),'%'),
Desk = paste0(round(Porcentagem_Desk*100,2),'%')
) %>%
select(grupo2, App, Msite, Desk) %>%
knitr::kable(caption = "") %>%
kable_styling(bootstrap_options = "striped", full_width = T, font_size = 15)| grupo2 | App | Msite | Desk |
|---|---|---|---|
| Não Cliente | 19.64% | 64.89% | 15.47% |
| Cliente | 53.46% | 30.47% | 16.07% |
| Diferenca | 33.82% | -34.43% | 0.6% |
aux %>%
ggplot() +
geom_col(aes(x=grupo2,y=porcentagem, fill = prim_device))+
scale_y_continuous(labels = scales::percent_format())+
labs(title = "Clientes por Primeiro Device",
x = "Grupos",
y = "Porcentagem"
)+
theme(axis.text.x = element_text(angle = 15, hjust = 1))documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(dias_sessao = median(dias_sessao),
sessoes_total = median(sessoes_total),
tempo_visita = round(median(active_time_on_site, na.rm = TRUE)/60),
qtd_dias_pra_cadastro = median(qtd_dias_cadastro)) %>%
knitr::kable(caption = "Quantidade de sessões por grupo") %>%
kable_styling()| grupo2 | dias_sessao | sessoes_total | tempo_visita | qtd_dias_pra_cadastro |
|---|---|---|---|---|
| Não Cliente | 1 | 1 | 4 | NA |
| Cliente | 1 | 2 | 42 | 0 |
# documento_completo %>%
# filter(!is.na(active_time_on_site)) %>%
# group_by(grupo2) %>%
# summarise(tempo_visita = median(active_time_on_site)/60) %>%
# ggplot() +
# geom_col(aes(y=tempo_visita,x=grupo2, fill = grupo2), show.legend = F, size = 5)+
# #scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Tempo de Sessão Ativo On-Site",
# x = "Grupos",
# y = "Tempo (min)"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(flag_app = sum(flag_app)/n()) %>%
mutate(flag_app = paste0(round(flag_app*100,2), '%')
) %>%
knitr::kable(caption = "Quantidade de sessões por grupo") %>%
kable_styling()| grupo2 | flag_app |
|---|---|
| Não Cliente | 19.64% |
| Cliente | 61.08% |
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(flag_app = sum(flag_app)/n()) %>%
# ggplot() +
# geom_point(aes(y=flag_app,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=flag_app,x=grupo2, group = 1), alpha = 0.3)+
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Clientes com App",
# x = "Grupos",
# y = "Porcentagem"
# )Não é justo comparar “evento por visita”, em todos os grupos a primeira visita tem muito mais tempo de sessão que as demais. Dar o mesmo peso para clientes com mais de uma visita e clientes com apenas uma não faz sentido.
aux <- documento_completo %>%
filter(pre_cadastro == 1) %>%
select(grupo2, product_view,add_to_cart,add_to_favorites,remove_from_cart,checkout, starts_with('is'), survey, home_views) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise_if(is.numeric, sum, na.rm = TRUE) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(contagem = n()),
by = 'grupo2'
)
aux <- aux %>%
select(-is_purchase) %>%
mutate_if(is.numeric, funs(./contagem)) %>%
t()
colnames(aux) <- aux[1,]
aux <- aux[-1,]
aux <- as.data.frame(aux)
Eventos <- rownames(aux)
rownames(aux) <- NULL
aux <- cbind(Eventos,aux)
aux <- aux %>%
rename(sem_cadastro = 'Não Cliente',
com_cadastro = 'Cliente') %>%
mutate(sem_cadastro = as.numeric(as.character(sem_cadastro)),
com_cadastro = as.numeric(as.character(com_cadastro))) %>%
mutate(diferenca = sem_cadastro-com_cadastro)
datatable(aux %>%
rename('Sem Cadastro' = sem_cadastro,
'Com Cadastro' = com_cadastro) %>%
mutate(Eventos = str_replace(Eventos, '2', ''),
Eventos = str_replace(Eventos, '_', ' '),
Eventos = str_replace(Eventos, '_', ' '),
Eventos = str_replace(Eventos, 'is', '')
),
caption = 'Eventos') %>%
formatPercentage (c("Sem Cadastro", "Com Cadastro", "diferenca"), digits = 2) %>%
formatStyle(
c('diferenca'),
color = styleInterval(0, c('red', 'green'))
) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(product_view, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(product_view, na.rm = T)),
by = 'grupo2'
)# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(product_view, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(product_view, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(add_to_cart, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(add_to_cart, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(add_to_cart), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(add_to_cart), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
group_by(grupo2, first_page_type, flag) %>%
summarise(contagem = n()) %>%
group_by(grupo2, flag) %>%
mutate(porcentagem = contagem/sum(contagem)) %>%
filter(grupo2 != 'Cliente')documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(add_to_cart), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(add_to_cart), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(add_to_cart, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(add_to_cart, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(add_to_favorites, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(add_to_favorites, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(add_to_favorites), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(add_to_favorites), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(add_to_favorites), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(add_to_favorites, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(add_to_favorites, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(remove_from_cart, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(remove_from_cart, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(remove_from_cart), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(remove_from_cart), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(remove_from_cart), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(remove_from_cart, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(remove_from_cart, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(checkout, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(checkout, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(checkout), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(checkout), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(checkout), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(checkout, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(checkout, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_my_account, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_my_account, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_my_account), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_my_account), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_my_account), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_my_account, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_my_account, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_mylook, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_mylook, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_mylook), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_mylook), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_mylook), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_mylook, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_mylook, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_content, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_content, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_content), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_content), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_content), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_content, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_content, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_faq, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_faq, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_faq), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_faq), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_faq), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_faq, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_faq, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_login, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_login, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_login), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_login), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_login), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_login, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_login, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_forgot_password, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_forgot_password, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_forgot_password), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_forgot_password), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_forgot_password), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_forgot_password, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_forgot_password, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_search, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_search, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_search), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_search), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_search), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_search, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_search, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_filter, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_filter, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_filter), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_filter), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_filter), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_filter, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_filter, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_sort, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_sort, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_sort), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_sort), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_sort), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_sort, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_sort, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_view_favorites, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_view_favorites, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_view_favorites), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_view_favorites), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_view_favorites), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_view_favorites, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_view_favorites, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_view_sizes, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_view_sizes, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_view_sizes), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_view_sizes), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_view_sizes), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_view_sizes, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_view_sizes, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_size_guide, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_size_guide, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_size_guide), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_size_guide), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_size_guide), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_size_guide, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_size_guide, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_fit_finder, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_fit_finder, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_fit_finder), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_fit_finder), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_fit_finder), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_fit_finder, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_fit_finder, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_another_color, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_another_color, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_another_color), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_another_color), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_another_color), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_another_color, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_another_color, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(survey, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(survey, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(survey), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(survey), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(survey), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(survey, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1,
# survey > 0) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(survey, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(home_views, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(home_views, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(home_views), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(home_views), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(home_views), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(home_views, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1,
# home_views > 0) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(home_views, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_image_search, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_image_search, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_image_search), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_image_search), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_image_search), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_image_search, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1,
# is_image_search > 0) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_image_search, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_dft_eco, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_dft_eco, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_dft_eco), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_dft_eco), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_dft_eco), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_dft_eco, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1,
# is_dft_eco > 0) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_dft_eco, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(is_weekly_campaign, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(is_weekly_campaign, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_weekly_campaign), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_weekly_campaign), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(is_weekly_campaign), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(is_weekly_campaign, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1,
# is_weekly_campaign > 0) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(is_weekly_campaign, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo2) %>%
summarise(Clientes_Que_Usaram = sum(bounce_sessions, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(Qtd_Utilizacoes = median(bounce_sessions, na.rm = T)),
by = 'grupo2'
)documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(bounce_sessions), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo2, nrow = 2) +
xlim(0,100)## Warning: Removed 243724 rows containing non-finite values (stat_boxplot).
documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(bounce_sessions), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo2) documento_completo %>%
filter(pre_cadastro == 1) %>%
mutate(flag = ifelse(is.na(bounce_sessions), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo2) # documento_completo %>%
# filter(pre_cadastro == 1) %>%
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo2) %>%
# summarise(product_view = sum(bounce_sessions, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo %>%
# filter(pre_cadastro == 1,
# bounce_sessions > 0) %>%
# group_by(grupo2) %>%
# summarise(product_view = median(bounce_sessions, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo2, color = grupo2), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo2, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )aux <- documento_completo %>%
filter(pre_cadastro == 1) %>%
group_by(grupo2) %>%
summarise(respostas = sum(flag_resposta, na.rm = T)) %>%
select(grupo2, respostas)
aux %>%
knitr::kable(caption = "Quantidade de respostas por grupo") %>%
kable_styling()| grupo2 | respostas |
|---|---|
| Não Cliente | 128 |
| Cliente | 154 |
documento_completo %>%
filter(pre_cadastro == 1) %>%
select(grupo2, marcas, comodidade, nenhuma, preco, qualidade, inspiracao, variedade, diversidade, inovacao, inspiracao, sapato_e_roupa) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
melt(id.vars = 'grupo2') %>%
filter(!is.na(value)) %>%
group_by(grupo2, variable) %>%
summarise(value = sum(value)) %>%
inner_join(aux, by = 'grupo2') %>%
mutate(porcentagem = value/respostas) %>%
ggplot() +
geom_col(aes(y=variable, x=porcentagem, fill=grupo2), position = 'dodge')documento_completo2 <- documento_completo %>%
filter((pre_cadastro == 1 | pre_prim_compra == 1),
grupo != 'Não Cliente') %>%
mutate(grupo3 = ifelse(grupo == 'Não Cliente', 'Não Cliente',
ifelse(grupo == 'Cliente - Sem compra', 'Cliente - Sem compra',
'Cliente - Com compra')),
grupo3 = factor(grupo3, levels = c('Não Cliente','Cliente - Sem compra', 'Cliente - Com compra'))
)
documento_completo2 <- documento_completo2 %>%
group_by(pk_fvid, flag_cliente, grupo3,qtd_dias_cadastro,
qtd_dias_primeira_compra,first_page_type,prim_device) %>%
summarise_if(is.numeric, sum) %>%
ungroup()
documento_completo2 <- documento_completo2 %>%
mutate(flag_app = ifelse(flag_app>0,1,0))Foram utilizados dados de 500.000 Não clientes para análises abaixo
Catálogo muito acessado por clientes sem compra
aux <- documento_completo2 %>%
mutate(first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
group_by(grupo3, first_page_type) %>%
summarise(contagem = n()) %>%
group_by(grupo3) %>%
mutate(porcentagem = contagem/sum(contagem))
aux2 <- aux %>%
filter(first_page_type == 'Catalog') %>%
rename(Catalogo = porcentagem) %>%
select(grupo3, Catalogo) %>%
inner_join(
aux %>%
filter(first_page_type == 'Homepage') %>%
rename(Homepage = porcentagem) %>%
select(grupo3,Homepage),
by = 'grupo3'
)%>%
inner_join(
aux %>%
filter(first_page_type == 'Product') %>%
rename(Product = porcentagem) %>%
select(grupo3, Product),
by = 'grupo3'
)%>%
inner_join(
aux %>%
filter(first_page_type == 'Other') %>%
rename(Other = porcentagem) %>%
select(grupo3, Other),
by = 'grupo3'
)
aux2 <- aux2 %>%
union_all(
(aux2 %>%
filter(grupo3 != 'Cliente - Sem compra') %>%
select(-grupo3)) - (
aux2 %>%
filter(grupo3 == 'Cliente - Sem compra') %>%
select(-grupo3))
)
aux2 %>%
ungroup() %>%
mutate(grupo3 = ifelse(is.na(grupo3), 'Diferenca', as.character(grupo3)),
Catalogo = paste0(round(Catalogo*100,2),'%'),
Homepage = paste0(round(Homepage*100,2),'%'),
Product = paste0(round(Product*100,2),'%'),
Other = paste0(round(Other*100,2),'%')
) %>%
knitr::kable(caption = "") %>%
kable_styling(bootstrap_options = "striped", full_width = T, font_size = 15)| grupo3 | Catalogo | Homepage | Product | Other |
|---|---|---|---|---|
| Cliente - Sem compra | 49.3% | 9.51% | 31.52% | 9.67% |
| Cliente - Com compra | 32.88% | 21.21% | 31.16% | 14.76% |
| Diferenca | -16.42% | 11.7% | -0.37% | 5.08% |
aux %>%
ggplot() +
geom_col(aes(x=grupo3,y=porcentagem, fill = first_page_type))+
scale_y_continuous(labels = scales::percent_format())+
labs(title = "Clientes por página de entrada",
x = "Grupos",
y = "Porcentagem"
)+
theme(axis.text.x = element_text(angle = 15, hjust = 1))aux <- documento_completo2 %>%
group_by(grupo3, prim_device) %>%
summarise(contagem = n()) %>%
group_by(grupo3) %>%
mutate(porcentagem = contagem/sum(contagem))
aux2 <-aux %>%
filter(prim_device == 'app') %>%
rename(App = contagem,
Porcentagem_App = porcentagem) %>%
select(grupo3, Porcentagem_App) %>%
inner_join(
aux %>%
filter(prim_device == 'm.site') %>%
rename(Msite = contagem,
Porcentagem_Msite = porcentagem) %>%
select(grupo3,Porcentagem_Msite),
by = 'grupo3'
)%>%
inner_join(
aux %>%
filter(prim_device == 'site') %>%
rename(Desk = contagem,
Porcentagem_Desk = porcentagem) %>%
select(grupo3, Porcentagem_Desk),
by = 'grupo3'
)
aux2 <- aux2 %>%
union_all(
(aux2 %>%
filter(grupo3 != 'Cliente - Sem compra') %>%
select(-grupo3)) - (
aux2 %>%
filter(grupo3 == 'Cliente - Sem compra') %>%
select(-grupo3))
)
aux2 %>%
ungroup() %>%
mutate(grupo3 = ifelse(is.na(grupo3), 'Diferenca', as.character(grupo3)),
App = paste0(round(Porcentagem_App*100,2),'%'),
Msite = paste0(round(Porcentagem_Msite*100,2),'%'),
Desk = paste0(round(Porcentagem_Desk*100,2),'%')
) %>%
select(grupo3, App, Msite, Desk) %>%
knitr::kable(caption = "") %>%
kable_styling(bootstrap_options = "striped", full_width = T, font_size = 15)| grupo3 | App | Msite | Desk |
|---|---|---|---|
| Cliente - Sem compra | 72.77% | 17.15% | 10.08% |
| Cliente - Com compra | 37.08% | 41.77% | 21.15% |
| Diferenca | -35.69% | 24.62% | 11.08% |
aux %>%
ggplot() +
geom_col(aes(x=grupo3,y=porcentagem, fill = prim_device))+
scale_y_continuous(labels = scales::percent_format())+
labs(title = "Clientes por Primeiro Device",
x = "Grupos",
y = "Porcentagem"
)+
theme(axis.text.x = element_text(angle = 15, hjust = 1))documento_completo2 %>%
mutate(qtd_dias_cadastro = qtd_dias_cadastro*-1,
qtd_dias_primeira_compra = qtd_dias_primeira_compra*-1) %>%
group_by(grupo3) %>%
summarise(dias_sessao = median(dias_sessao),
sessoes_total = median(sessoes_total),
tempo_visita = round(median(active_time_on_site, na.rm = TRUE)/60),
qtd_dias_pra_cadastro = median(qtd_dias_cadastro),
qtd_dias_primeira_compra = median(qtd_dias_primeira_compra)) %>%
knitr::kable(caption = "Quantidade de sessões por grupo") %>%
kable_styling()| grupo3 | dias_sessao | sessoes_total | tempo_visita | qtd_dias_pra_cadastro | qtd_dias_primeira_compra |
|---|---|---|---|---|---|
| Cliente - Sem compra | 4 | 6 | 56 | 0 | NA |
| Cliente - Com compra | 2 | 4 | 72 | 1 | 5 |
# documento_completo2 %>%
# filter(!is.na(active_time_on_site)) %>%
# group_by(grupo3) %>%
# summarise(tempo_visita = median(active_time_on_site)/60) %>%
# ggplot() +
# geom_col(aes(y=tempo_visita,x=grupo3, fill = grupo3), show.legend = F, size = 5)+
# #scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Tempo de Sessão Ativo On-Site",
# x = "Grupos",
# y = "Tempo (min)"
# )documento_completo2 %>%
group_by(grupo3) %>%
summarise(flag_app = sum(flag_app)/n()) %>%
mutate(flag_app = paste0(round(flag_app*100,2), '%')
) %>%
knitr::kable(caption = "Quantidade de sessões por grupo") %>%
kable_styling()| grupo3 | flag_app |
|---|---|
| Cliente - Sem compra | 77.86% |
| Cliente - Com compra | 50.33% |
# documento_completo2 %>%
# group_by(grupo3) %>%
# summarise(flag_app = sum(flag_app)/n()) %>%
# ggplot() +
# geom_point(aes(y=flag_app,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=flag_app,x=grupo3, group = 1), alpha = 0.3)+
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Clientes com App",
# x = "Grupos",
# y = "Porcentagem"
# )Não é justo comparar “evento por visita”, em todos os grupos a primeira visita tem muito mais tempo de sessão que as demais. Dar o mesmo peso para clientes com mais de uma visita e clientes com apenas uma não faz sentido.
aux <- documento_completo2 %>%
select(grupo3, product_view,add_to_cart,add_to_favorites,remove_from_cart,checkout, starts_with('is'), survey, home_views) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise_if(is.numeric, sum, na.rm = TRUE) %>%
inner_join(documento_completo2 %>%
group_by(grupo3) %>%
summarise(contagem = n()),
by = 'grupo3'
)
aux <- aux %>%
select(-is_purchase) %>%
mutate_if(is.numeric, funs(./contagem)) %>%
t()
colnames(aux) <- aux[1,]
aux <- aux[-1,]
aux <- as.data.frame(aux)
Eventos <- rownames(aux)
rownames(aux) <- NULL
aux <- cbind(Eventos,aux)
aux <- aux %>%
rename(sem_compra = 'Cliente - Sem compra',
com_compra = 'Cliente - Com compra') %>%
mutate(sem_compra = as.numeric(as.character(sem_compra)),
com_compra = as.numeric(as.character(com_compra)))
datatable(aux %>%
mutate(diferenca = sem_compra - com_compra) %>%
rename('Cliente - Sem compra' = sem_compra,
'Cliente - Com compra' = com_compra,
) %>%
mutate(Eventos = str_replace(Eventos, '2', ''),
Eventos = str_replace(Eventos, '_', ' '),
Eventos = str_replace(Eventos, '_', ' '),
Eventos = str_replace(Eventos, 'is', '')
),
caption = 'Eventos') %>%
formatPercentage (c("Cliente - Sem compra", "Cliente - Com compra", "diferenca"),
digits = 2) %>%
formatStyle(
c('diferenca'),
color = styleInterval(0, c('red', 'green'))
) documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(product_view, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(product_view, na.rm = T)),
by = 'grupo3'
) %>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 86.24% | 27 |
| Cliente - Com compra | 97.96% | 22 |
# documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(product_view, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
# filter(pre_cadastro == 1) %>%
# group_by(grupo3) %>%
# summarise(product_view = median(product_view, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(add_to_cart, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(add_to_cart, na.rm = T)),
by = 'grupo3'
) %>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 48.4% | 5 |
| Cliente - Com compra | 85.13% | 4 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(add_to_cart), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(add_to_cart), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(add_to_cart), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(add_to_cart, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(add_to_cart, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(add_to_favorites, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(add_to_favorites, na.rm = T)),
by = 'grupo3'
) %>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 4.87% | 6 |
| Cliente - Com compra | 7.21% | 4 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(add_to_favorites), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(add_to_favorites), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(add_to_favorites), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(add_to_favorites, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(add_to_favorites, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(remove_from_cart, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(remove_from_cart, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 19.68% | 5 |
| Cliente - Com compra | 26.88% | 4 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(remove_from_cart), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(remove_from_cart), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(remove_from_cart), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(remove_from_cart, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(remove_from_cart, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(checkout, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(checkout, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 39.18% | 4 |
| Cliente - Com compra | 89.39% | 6 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(checkout), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(checkout), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(checkout), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(checkout, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(checkout, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_my_account, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_my_account, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 14.79% | 2 |
| Cliente - Com compra | 38.51% | 1 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_my_account), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_my_account), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_my_account), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_my_account, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_my_account, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_mylook, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_mylook, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 0.02% | 1 |
| Cliente - Com compra | 0.08% | 1 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_mylook), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_mylook), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_mylook), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_mylook, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_mylook, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_content, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_content, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 1.74% | 1 |
| Cliente - Com compra | 8.87% | 1 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_content), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_content), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_content), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_content, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_content, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_faq, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_faq, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 0.62% | 1 |
| Cliente - Com compra | 3.21% | 1 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_faq), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_faq), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_faq), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_faq, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_faq, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_login, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_login, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 45.87% | 2 |
| Cliente - Com compra | 66.86% | 1 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_login), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_login), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_login), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_login, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_login, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_forgot_password, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_forgot_password, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 0.13% | 1 |
| Cliente - Com compra | 0.88% | 1 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_forgot_password), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_forgot_password), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_forgot_password), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_forgot_password, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_forgot_password, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_search, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_search, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 74.37% | 5 |
| Cliente - Com compra | 61.19% | 3 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_search), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_search), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_search), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_search, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_search, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_filter, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_filter, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 15.8% | 2 |
| Cliente - Com compra | 31.11% | 2 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_filter), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_filter), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_filter), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_filter, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_filter, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_sort, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_sort, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 10.5% | 3 |
| Cliente - Com compra | 14.37% | 2 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_sort), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_sort), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_sort), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_sort, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_sort, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_view_favorites, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_view_favorites, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 2.66% | 1 |
| Cliente - Com compra | 3.23% | 1 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_view_favorites), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_view_favorites), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_view_favorites), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_view_favorites, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_view_favorites, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_view_sizes, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_view_sizes, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 11.11% | 2 |
| Cliente - Com compra | 44.76% | 1 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_view_sizes), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_view_sizes), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_view_sizes), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_view_sizes, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_view_sizes, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_size_guide, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_size_guide, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 7.42% | 2 |
| Cliente - Com compra | 17.33% | 1 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_size_guide), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_size_guide), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_size_guide), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_size_guide, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_size_guide, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_fit_finder, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_fit_finder, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 4.48% | 2 |
| Cliente - Com compra | 10.98% | 1 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_fit_finder), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_fit_finder), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_fit_finder), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_fit_finder, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_fit_finder, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_another_color, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_another_color, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 2.86% | 3 |
| Cliente - Com compra | 11.95% | 2 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_another_color), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_another_color), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_another_color), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_another_color, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
#
# group_by(grupo3) %>%
# summarise(product_view = median(is_another_color, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(survey, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(survey, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 0.07% | 0 |
| Cliente - Com compra | 0.07% | 0 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(survey), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(survey), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(survey), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(survey, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
# filter(pre_cadastro == 1,
# survey > 0) %>%
# group_by(grupo3) %>%
# summarise(product_view = median(survey, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(home_views, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(home_views, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 22.18% | 0 |
| Cliente - Com compra | 46.05% | 0 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(home_views), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(home_views), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(home_views), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(home_views, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
# filter(pre_cadastro == 1,
# home_views > 0) %>%
# group_by(grupo3) %>%
# summarise(product_view = median(home_views, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_image_search, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_image_search, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 14.12% | 0 |
| Cliente - Com compra | 7.53% | 0 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_image_search), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_image_search), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_image_search), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_image_search, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
# filter(pre_cadastro == 1,
# is_image_search > 0) %>%
# group_by(grupo3) %>%
# summarise(product_view = median(is_image_search, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_dft_eco, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_dft_eco, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 0.04% | 0 |
| Cliente - Com compra | 0.04% | 0 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_dft_eco), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_dft_eco), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_dft_eco), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_dft_eco, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
# filter(pre_cadastro == 1,
# is_dft_eco > 0) %>%
# group_by(grupo3) %>%
# summarise(product_view = median(is_dft_eco, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(is_weekly_campaign, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(is_weekly_campaign, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 0.93% | 0 |
| Cliente - Com compra | 0.22% | 0 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_weekly_campaign), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(is_weekly_campaign), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(is_weekly_campaign), 'Sem comportamento',
'Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(is_weekly_campaign, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
# filter(pre_cadastro == 1,
# is_weekly_campaign > 0) %>%
# group_by(grupo3) %>%
# summarise(product_view = median(is_weekly_campaign, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )documento_completo2 %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
group_by(grupo3) %>%
summarise(Clientes_Que_Usaram = sum(bounce_sessions, na.rm = T)/n()) %>%
mutate(Clientes_Que_Usaram = paste0(round(Clientes_Que_Usaram*100,2),'%')) %>%
inner_join(documento_completo2 %>%
filter(pre_cadastro == 1) %>%
group_by(grupo3) %>%
summarise(Qtd_Utilizacoes = median(bounce_sessions, na.rm = T)),
by = 'grupo3'
)%>%
knitr::kable(caption = "") %>%
kable_styling()| grupo3 | Clientes_Que_Usaram | Qtd_Utilizacoes |
|---|---|---|
| Cliente - Sem compra | 60.63% | 1 |
| Cliente - Com compra | 56.23% | 1 |
documento_completo2 %>%
mutate(flag = ifelse(is.na(bounce_sessions), 'Sem comportamento','Com Comportamento')) %>% ggplot() +
geom_boxplot(aes(x=active_time_on_site/60, y=flag, color = flag), show.legend = F) +
facet_wrap(. ~ grupo3, nrow = 2) +
xlim(0,100)## Warning: Removed 160586 rows containing non-finite values (stat_boxplot).
documento_completo2 %>%
mutate(flag = ifelse(is.na(bounce_sessions), 'Sem comportamento','Com Comportamento'),
first_page_type = ifelse(first_page_type != 'Product' & first_page_type != 'Catalog' & first_page_type != 'Homepage',
'Other', as.character(first_page_type))) %>%
ggplot() +
geom_bar(aes(x=flag, fill = first_page_type), position = 'fill') +
facet_wrap(. ~ grupo3) documento_completo2 %>%
mutate(flag = ifelse(is.na(bounce_sessions), 'Sem comportamento','Com Comportamento')) %>%
ggplot() +
geom_bar(aes(x=flag, fill = prim_device), position = 'fill') +
facet_wrap(. ~ grupo3) # documento_completo2 %>%
#
# mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
# group_by(grupo3) %>%
# summarise(product_view = sum(bounce_sessions, na.rm = T)/n()) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# scale_y_continuous(labels = scales::percent_format())+
# labs(title = "Porcentagem de clientes com este comportamento",
# x = "Grupo",
# y = "Porcentagem"
# )
#
#
#
# documento_completo2 %>%
# filter(pre_cadastro == 1,
# bounce_sessions > 0) %>%
# group_by(grupo3) %>%
# summarise(product_view = median(bounce_sessions, na.rm = T)) %>%
# ggplot() +
# geom_point(aes(y=product_view,x=grupo3, color = grupo3), show.legend = F, size = 5)+
# geom_line(aes(y=product_view,x=grupo3, group = 1), show.legend = F, alpha = 0.2) +
# labs(title = "Quantidade de usos deste comportamento",
# x = "Grupo",
# y = "Usos"
# )aux <- documento_completo2 %>%
group_by(grupo3) %>%
summarise(respostas = sum(flag_resposta, na.rm = T)) %>%
select(grupo3, respostas)
aux %>%
knitr::kable(caption = "Quantidade de respostas por grupo") %>%
kable_styling()| grupo3 | respostas |
|---|---|
| Cliente - Sem compra | 14 |
| Cliente - Com compra | 86 |
documento_completo2 %>%
select(grupo3, marcas, comodidade, nenhuma, preco, qualidade, inspiracao,
variedade, diversidade, inovacao, inspiracao, sapato_e_roupa) %>%
mutate_if(is.numeric, funs(ifelse(.>=1,1,0))) %>%
melt(id.vars = 'grupo3') %>%
filter(!is.na(value)) %>%
group_by(grupo3, variable) %>%
summarise(value = sum(value)) %>%
inner_join(aux, by = 'grupo3') %>%
mutate(porcentagem = value/respostas) %>%
ggplot() +
geom_col(aes(y=variable, x=porcentagem, fill=grupo3), position = 'dodge')
Social Login